package com.be.beadmin.product.impl;

import com.be.beadmin.product.entity.PurchaseOrderInfo;
import com.be.beadmin.product.repository.PurchaseOrderInfoRepository;
import com.be.beadmin.product.service.PurchaseOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PurchaseOrderInfoImpl implements PurchaseOrderInfoService {

    @Autowired
    private PurchaseOrderInfoRepository purchaseOrderInfoRepository;
    @Override
    public PurchaseOrderInfo getPurchaseOrderInfo(String po, String poItem) {
        return purchaseOrderInfoRepository.findPurchaseOrderInfoByPoAndPoItem(po, poItem);
    }

    @Override
    public void insertPurchaseOrderInfo(PurchaseOrderInfo purchaseOrderInfo) {
        purchaseOrderInfoRepository.save(purchaseOrderInfo);
    }
}
